This is an Rmarkdown document.
This is bold This is italic
suppressPackageStartupMessages(library(tidyverse))
glimpse(storms)
## Observations: 10,010
## Variables: 13
## $ name <chr> "Amy", "Amy", "Amy", "Amy", "Amy", "Amy", "Amy", "Am…
## $ year <dbl> 1975, 1975, 1975, 1975, 1975, 1975, 1975, 1975, 1975…
## $ month <dbl> 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7…
## $ day <int> 27, 27, 27, 27, 28, 28, 28, 28, 29, 29, 29, 29, 30, …
## $ hour <dbl> 0, 6, 12, 18, 0, 6, 12, 18, 0, 6, 12, 18, 0, 6, 12, …
## $ lat <dbl> 27.5, 28.5, 29.5, 30.5, 31.5, 32.4, 33.3, 34.0, 34.4…
## $ long <dbl> -79.0, -79.0, -79.0, -79.0, -78.8, -78.7, -78.0, -77…
## $ status <chr> "tropical depression", "tropical depression", "tropi…
## $ category <ord> -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0,…
## $ wind <int> 25, 25, 25, 25, 25, 25, 25, 30, 35, 40, 45, 50, 50, …
## $ pressure <int> 1013, 1013, 1013, 1013, 1012, 1012, 1011, 1006, 1004…
## $ ts_diameter <dbl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, …
## $ hu_diameter <dbl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, …
library("viridis")
ggplot(data=storms)+
geom_jitter(aes(x= as.factor(month), y = pressure, fill = wind), pch = 21, alpha = 0.05)+
scale_fill_viridis_c()+
theme_bw()+
labs(title= "Hurricane Pressure v Month", subtitle = "with Max Wind Speed", x = "Month")
Writing out equations in Rmarkdown:
If you want to write an equation, you put a $ on either side of it.
\(\sum_{i=y}^n X_i\)
library(knitr)
kable(head(storms), caption = "Table using Kable")
| name | year | month | day | hour | lat | long | status | category | wind | pressure | ts_diameter | hu_diameter |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Amy | 1975 | 6 | 27 | 0 | 27.5 | -79.0 | tropical depression | -1 | 25 | 1013 | NA | NA |
| Amy | 1975 | 6 | 27 | 6 | 28.5 | -79.0 | tropical depression | -1 | 25 | 1013 | NA | NA |
| Amy | 1975 | 6 | 27 | 12 | 29.5 | -79.0 | tropical depression | -1 | 25 | 1013 | NA | NA |
| Amy | 1975 | 6 | 27 | 18 | 30.5 | -79.0 | tropical depression | -1 | 25 | 1013 | NA | NA |
| Amy | 1975 | 6 | 28 | 0 | 31.5 | -78.8 | tropical depression | -1 | 25 | 1012 | NA | NA |
| Amy | 1975 | 6 | 28 | 6 | 32.4 | -78.7 | tropical depression | -1 | 25 | 1012 | NA | NA |
htmlTable::htmlTable(head(storms))
| name | year | month | day | hour | lat | long | status | category | wind | pressure | ts_diameter | hu_diameter | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | Amy | 1975 | 6 | 27 | 0 | 27.5 | -79 | tropical depression | -1 | 25 | 1013 | ||
| 2 | Amy | 1975 | 6 | 27 | 6 | 28.5 | -79 | tropical depression | -1 | 25 | 1013 | ||
| 3 | Amy | 1975 | 6 | 27 | 12 | 29.5 | -79 | tropical depression | -1 | 25 | 1013 | ||
| 4 | Amy | 1975 | 6 | 27 | 18 | 30.5 | -79 | tropical depression | -1 | 25 | 1013 | ||
| 5 | Amy | 1975 | 6 | 28 | 0 | 31.5 | -78.8 | tropical depression | -1 | 25 | 1012 | ||
| 6 | Amy | 1975 | 6 | 28 | 6 | 32.4 | -78.7 | tropical depression | -1 | 25 | 1012 |
#make an interactive table
DT::datatable(storms)
## Warning in instance$preRenderHook(instance): It seems your data is too
## big for client-side DataTables. You may consider server-side processing:
## https://rstudio.github.io/DT/server.html
library(plotly)
##
## Attaching package: 'plotly'
## The following object is masked from 'package:ggplot2':
##
## last_plot
## The following object is masked from 'package:stats':
##
## filter
## The following object is masked from 'package:graphics':
##
## layout
ggplotly(ggplot(data=storms)+
geom_jitter(aes(x= as.factor(month), y = pressure, fill = wind), pch = 21, alpha = 0.05)+
scale_fill_viridis_c()+
theme_bw()+
labs(title= "Hurricane Pressure v Month", subtitle = "with Max Wind Speed", x = "Month"))
## Warning in L$marker$color[idx] <- aes2plotly(data, params, "fill")[idx]:
## number of items to replace is not a multiple of replacement length